{block name='content'}
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body padding-40 margin-bottom-40">
        <div class="layui-form-item layui-row layui-col-space15">
            <div class="layui-col-xs6 block relative">
                <span class="color-green label-required-prev">柜点设备名称</span><span class="margin-left-5 color-desc">Store Type</span>
                <select class="layui-select" lay-verify="required" required lay-search name="d_id">
                    <option value="">请选择 设备</option>
                    {foreach name="$devices" id="val"}
                    {if isset($vo.d_id) AND $vo.d_id eq $key}
                    <option selected value="{$key}">{$val}</option>
                    {else}
                    <option value="{$key}">{$val}</option>
                    {/if}
                    {/foreach}
                </select>
            </div>

            <div class="layui-col-xs6 block relative">
                <span class="color-green label-required-prev">箱格类型</span><span class="margin-left-5 color-desc">Box Type</span>
                <select class="layui-select set_name" lay-search name="box_type">
                    <option value="">请选择 箱格类型</option>
                    {php} $box_type = 3; {/php}
                    {foreach name="$box_types" id="val"}
                    {if $box_type eq $key}
                    <option selected value="{$key}">{$val}</option>
                    {else}
                    <option value="{$key}">{$val}</option>
                    {/if}
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item layui-row layui-col-space15">
            <div class="layui-col-xs6 block relative">
                <span class="color-green label-required-prev">设备主板版号</span><span class="margin-left-5 color-desc">Device Board</span>

                <input class="layui-input" name="device_board" lay-verify="required" required value="{$vo.device_board|default=''}" placeholder="请输入设备主板版号">
            </div>

            <div class="layui-col-xs6 block relative">
                <span class="color-green label-required-prev">箱格数量</span><span class="margin-left-5 color-desc">Box Number</span>

                <input class="layui-input" name="num" lay-verify="required" required value="{$vo.num|default=''}" placeholder="请输入箱格数量">
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        {if $title!="查看柜点"}
        <button class="layui-btn" lay-submit lay-filter="submit">保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-history-back>取消编辑</button>
        {/if}
    </div>
</form>
{/block}

{block name='script'}
<script>
    (function () {
        var title = "{$title}";
        if(title=='查看柜点'){
            $("input,select").attr("readOnly", true);
        }

        layui.form.render();

    })();
</script>
{/block}